<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
    }
    .box{
        width: 30%;
        height: 500px;
        background: tomato;
        position: relative;
        margin: 100px;
    }
    .item{
        width: 50%;
        height: 50%;
        background: cadetblue;
        margin: 50px;
    }
</style>
<body>
<div class="box">
    <div class="item">

    </div>
</div>
<script>
    var box = document.querySelector('.box');
    var item = document.querySelector('.item');
    console.log(box.offsetTop);
    console.log(box.offsetLeft);
    console.log(box.offsetWidth);
    console.log(box.offsetHeight);
    console.log(item.offsetWidth);
    console.log(item.offsetParent);
</script>
</body>
</html>